#include "acl/acl.h"
#include "acl/ops/acl_dvpp.h"
#include "acl/ops/acl_cblas.h"

aclError SinhCustom(aclTensorDesc *inputDesc, aclDataBuffer *inputBuffer, aclTensorDesc *outputDesc, aclDataBuffer *outputBuffer) {
    const char* const operatorName = "SinhCustom";
    auto opAttr = aclopCreateAttr();
    auto status = aclopCreateOperatorDesc(operatorName);
    if (status != ACL_ERROR_NONE) {
        printf("Failed to create operator description for %s\n", operatorName);
        return status;
    }

    status = aclopSetKernelArgs(opDesc, 1, inputBuffer, outputBuffer);
    if (status != ACL_ERROR_NONE) {
        printf("Failed to set kernel arguments for %s\n", operatorName);
        return status;
    }

    status = aclopExecuteV2(opDesc, 1, &inputDesc, &inputBuffer, &outputDesc, &outputBuffer, opAttr);
    if (status != ACL_ERROR_NONE) {
        printf("Failed to execute %s\n", operatorName);
    }

    aclopDestroyOperatorDesc(opDesc);
    aclopDestroyAttr(opAttr);
    return status;
}
